package com.le.tester.leetcode;

/**
 * 描述：爬楼梯
 */
public class ClimbStairs {
    public int climbStairs(int n) {
        int p;
        int q = 0;
        int r = 1;
        for (int i = 1; i <= n; i++) {
            p = q;
            q = r;
            r = q + p;
        }
        return r;
    }

    public static void main(String[] args) {
        System.out.println(new ClimbStairs().climbStairs(2));
    }
}
